home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / DEFAULT.H < prev    next >
C/C++ Source or Header  |  1992-02-10  |  6KB  |  211 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/default.h,v 9.38 1992/02/10 13:52:06 jinx Exp $
  4.  
  5. Copyright (c) 1988-1992 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* This file contains default definitions for some hooks which
  36.    various machines require.  These machines define these hooks
  37.    in CONFIG.H and this file defines them only if they remain
  38.    undefined. */
  39.  
  40. /* Compiler bug fixes. */
  41.  
  42. #ifndef And2
  43. #define And2(x, y)    ((x) && (y))
  44. #define And3(x, y, z) ((x) && (y) && (z))
  45. #define Or2(x, y)     ((x) || (y))
  46. #define Or3(x, y, z)  ((x) || (y) || (z))
  47. #endif
  48.  
  49. #ifndef MEMORY_FETCH
  50. /* These definitions allow a true multi-processor with shared memory
  51.    but no atomic longword operations (Butterfly and Concert,
  52.    for example) to supply their own atomic operators in config.h. */
  53. #define MEMORY_FETCH(locative) (locative)
  54. #define MEMORY_STORE(locative, object) (locative) = (object)
  55. #endif
  56.  
  57. #ifndef Get_Fixed_Obj_Slot
  58. #define Get_Fixed_Obj_Slot(N)    FAST_VECTOR_REF (Fixed_Objects, N)
  59. #define Set_Fixed_Obj_Slot(N,S)    FAST_VECTOR_SET (Fixed_Objects, N, S)
  60. #define Update_FObj_Slot(N, S)  Set_Fixed_Obj_Slot(N, S)
  61. #define Declare_Fixed_Objects()    SCHEME_OBJECT Fixed_Objects
  62. #define Valid_Fixed_Obj_Vector() (VECTOR_P (Fixed_Objects))
  63. #define Save_Fixed_Obj(Save_FO)                    \
  64.   Save_FO = Fixed_Objects;                    \
  65.   Fixed_Objects = SHARP_F;
  66. #define Restore_Fixed_Obj(Save_FO)                \
  67.   Fixed_Objects = Save_FO
  68. #endif
  69.  
  70.  
  71. /* Atomic swapping hook.  Used extensively. */
  72.  
  73. #ifndef SWAP_POINTERS
  74. #define SWAP_POINTERS(locative, object, target)                \
  75. {                                    \
  76.   (target) = (* (locative));                        \
  77.   (* (locative)) = (object);                        \
  78. }
  79. #endif
  80.  
  81. #ifndef USE_STACKLETS
  82.  
  83. #define Absolute_Stack_Base Constant_Top
  84.  
  85. #ifndef Initialize_Stack
  86. #define Initialize_Stack()                        \
  87. do                                    \
  88. {                                    \
  89.   Stack_Top = Highest_Allocated_Address;                \
  90.   Stack_Pointer = Stack_Top;                        \
  91.   Set_Stack_Guard (Absolute_Stack_Base + STACK_GUARD_SIZE);        \
  92. } while (0)
  93. #endif
  94.  
  95. #endif /* USE_STACKLETS */
  96.  
  97. #ifndef SET_CONSTANT_TOP
  98. #define SET_CONSTANT_TOP()                        \
  99. do                                    \
  100. {                                    \
  101.   ALIGN_FLOAT (Free_Constant);                        \
  102.   SEAL_CONSTANT_SPACE ();                        \
  103. } while (0)
  104. #endif
  105.  
  106. #ifndef TEST_CONSTANT_TOP
  107. #define TEST_CONSTANT_TOP(New_Top) ((New_Top) <= Constant_Top)
  108. #endif
  109.  
  110. #ifndef STACK_SANITY_CHECK
  111. #define STACK_SANITY_CHECK(name)                    \
  112. do                                    \
  113. {                                    \
  114.   if (!(CONSTANT_SPACE_SEALED ()))                    \
  115.   {                                    \
  116.     extern void EXFUN (stack_death, (CONST char *));            \
  117.                                     \
  118.     stack_death (name);                            \
  119.     /*NOTREACHED */                            \
  120.   }                                    \
  121. } while (0)
  122. #endif
  123.  
  124. /* Used in debug.c */
  125.  
  126. #ifndef Back_Trace_Entry_Hook
  127. #define Back_Trace_Entry_Hook()
  128. #endif
  129.  
  130. #ifndef Back_Trace_Exit_Hook
  131. #define Back_Trace_Exit_Hook()
  132. #endif
  133.  
  134. /* Used in extern.h */
  135.  
  136. #ifndef More_Debug_Flag_Externs
  137. #define More_Debug_Flag_Externs()
  138. #endif
  139.  
  140. /* Used in fasdump.c */
  141.  
  142. #ifndef Band_Dump_Permitted
  143. #define Band_Dump_Permitted()
  144. #endif
  145.  
  146. #ifndef Band_Load_Hook
  147. #define Band_Load_Hook()
  148. #endif
  149.  
  150. #ifndef Band_Dump_Exit_Hook
  151. #define Band_Dump_Exit_Hook()
  152. #endif
  153.  
  154. #ifndef Fasdump_Exit_Hook
  155. #define Fasdump_Exit_Hook()
  156. #endif
  157.  
  158. #ifndef Fasdump_Free_Calc
  159. #define Fasdump_Free_Calc(NewFree, NewMemtop, ignored)    \
  160.   NewFree = Unused_Heap;                \
  161.   NewMemTop = Unused_Heap_Top
  162. #endif
  163.  
  164. /* Used in interpret.c */
  165.  
  166. #ifndef Eval_Ucode_Hook
  167. #define Eval_Ucode_Hook()
  168. #endif
  169.  
  170. #ifndef Pop_Return_Ucode_Hook
  171. #define Pop_Return_Ucode_Hook()
  172. #endif
  173.  
  174. #ifndef Apply_Ucode_Hook
  175. #define Apply_Ucode_Hook()
  176. #endif
  177.  
  178. #ifndef End_GC_Hook
  179. #define End_GC_Hook()
  180. #endif
  181.  
  182. /* Used in storage.c */
  183.  
  184. #ifndef More_Debug_Flag_Allocs
  185. #define More_Debug_Flag_Allocs()
  186. #endif
  187.  
  188. /* Used in utils.c */
  189.  
  190. #ifndef Global_Interrupt_Hook
  191. #define Global_Interrupt_Hook()
  192. #endif
  193.  
  194. #ifndef Error_Exit_Hook
  195. #define Error_Exit_Hook()
  196. #endif
  197.  
  198. /* Common Lisp Hooks */
  199.  
  200. #ifndef SITE_EXPRESSION_DISPATCH_HOOK
  201. #define SITE_EXPRESSION_DISPATCH_HOOK()
  202. #endif
  203.  
  204. #ifndef SITE_RETURN_DISPATCH_HOOK
  205. #define SITE_RETURN_DISPATCH_HOOK()
  206. #endif
  207.  
  208. #ifndef FASLOAD_RELOCATE_HOOK
  209. #define FASLOAD_RELOCATE_HOOK(heap_low, heap_high, constant_low, constant_high)
  210. #endif
  211.